<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('dataupdate')}">
			<div>
				<dl>
					<dt></dt>
					<dd>
						<table class="table table-hover table-bordered">
							<tr>
								<td>资料名称</td>
								<td>上传人</td>
								<td>资料类型</td>
								<td>上传时间</td>
								<td>资料下载</td>
							</tr>
							<volist name="files" id="vo">
								<tr>
									<td>{$vo.file_name}</td>
									<td>{$vo.user_nickname}</td>
									<td>
										<switch name="vo.type">
											<case value="3">
												立项资料
											</case>
											<case value="4">
												落定资料
											</case>
											<case value="5">
												变更资料
											</case>
											<case value="6">
												凭证资料
											</case>
											<case value="7">
												完成资料
											</case>
										</switch>
									</td>
									<td>{$vo.create_time|date="Y-m-d",###}</td>
									<td><a href="{$vo.file|cmf_get_file_download_url}">下载</a></td>
								</tr>
								</switch>
							</volist>
						</table>
					</dd>
				</dl>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="form-required">*</span>资料上传</label>
				<div class="col-md-6 col-sm-10">
					<ul id="files" class="pic-list list-unstyled form-inline">
					</ul>
					<a href="javascript:uploadMultiFile('附件上传','#files','files-item-tpl');"
					   class="btn btn-sm btn-default">选择文件</a>				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<input type="hidden" name="pid" value="{$project.id}"/>
					<button type="submit" class="btn btn-primary js-ajax-submit">提交</button>
					<a class="btn btn-default" href="javascript:history.back(-1);">返回</a>
				</div>
			</div>
		</form>
	</div>
<script src="__STATIC__/js/admin.js"></script>
<script type="text/html" id="files-item-tpl">
	<li id="saved-file{id}">
		<input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}">
		<div class="input-group">
			<span class="input-group-addon">文件名称</span>
			<input class="form-control" id="file-{id}-name" type="text" name="file_names[]" value="{name}"
				   style="width: 200px;" title="文件名称">
			<span class="input-group-addon btn btn-success" onclick="javascript:uploadOne('图片上传','#file-{id}','file');">替换</span>
			<span class="input-group-addon btn btn-warning" onclick="javascript:(function(){$('#saved-file{id}').remove();})();">移除</span>
		</div>
	</li>
</script>
</body>
</html>